import request from '@/utils/request'
import json from 'highlight.js/lib/languages/json'
//提交
// 查询日常检查列表
export function getData(query) {
  return request({
    url: '/aqsc/check/data',
    method: 'post',
    data: query
  })
}

//查询部门信息
export function getDeptData() {
  return request({
    url: '/aqsc/check/getDept',
    method: 'get',
  })
}
//查询用户信息
export function getUserData() {
  return request({
    url: '/aqsc/check/getUser',
    method: 'get',
  })
}
// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'get'
  })
}

// 新增检查记录
export function addCheck(data) {
  return request({
    url: '/aqsc/check/add',
    method: 'post',
    data: data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/system/notice',
    method: 'put',
    data: data
  })
}

// 删除公告
export function deleteChecks(ids) {
  return request({
    url: '/aqsc/check/removes',
    method: 'delete',
    data:ids
  })
}
//上传
export function uploadFile(data) {
  return request({
    url: '/file/upload', //后端提供的接口
    method: 'post',
    data: data,
    headers: {
            'Content-Type': 'multipart/form-data'
    }
  })
}
//时间范围处理
// 添加日期范围
export function formatDateRange(params, dateRange) {
	var search = params;
	search.beginTime = "";
	search.endTime = "";
	if (null != dateRange && '' != dateRange) {
		search.beginTime = dateRange[0];
		search.endTime = dateRange[1];
	}
	return search;
}
